<!doctype html>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<html>
<head>
	<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
	<%
		String path = request.getContextPath();
	%>
	<%@ include file="/WEB-INF/views-jsp/include/taglib/taglib.jsp" %>
	<%@ include file="/WEB-INF/views-jsp/include/meta/meta.jsp" %>
	<%@ include file="/WEB-INF/views-jsp/include/link/link.jsp" %>
	<%@ include file="/WEB-INF/views-jsp/include/script/script.jsp" %>
	<link rel="stylesheet" type="text/css" href="${path}/html/js/js-resource/imgPreview/css/style.css"/>
	<script type="text/javascript" src="${path}/html/js/jquery.form.js"></script>
	<script type="text/javascript" src="${path}/html/js/js-jsp/uploadFile.js?v=<%out.print(Math.random());%>"></script>
	<script type="text/javascript" src="${path}/html/js/js-resource/imgPreview/js/lightBox.js"></script>
	<script type="text/javascript" src="${path}/html/js/js-jsp/us/user/userOption.js?v=<%out.print(Math.random());%>"></script>
</head>
	<body>
		<div class="place">
			<span>当前位置：</span>
			<ul class="placeul">
				<li><a href="${path}/user/index.do">用户管理</a></li>
				<li>
					<c:if test="${null == user.usId}">
						<a>添加用户</a>
					</c:if>
					<c:if test="${null != user.usId}">
						<a>编辑用户</a>
					</c:if>
				</li>
			</ul>
		</div>
		<form id="operate_form" class="form" method="post" action="#" enctype="multipart/form-data">
			<div class="formbody">
				<div class="formtitle"><span>基本信息</span></div>
				<ul class="forminfo">
					<li>
						<c:if test="${null != userPhoto.commonFile.fileId}">
							<img id="showImg" style="width:120px; height: 160px; margin-left: 40px" />
						</c:if>
						<c:if test="${null == userPhoto.commonFile.fileId}">
							<img id="showImg" style="width:120px; height: 160px; margin-left: 40px" src="${path}/html/images/defaulPhoto/defaulPhoto.jpg" />
						</c:if>
					</li>
					<li>
						<label>所属公司：</label>
						<input type="hidden" name="companyId" id="companyId" value="${user.companyId}">
                        <input type="hidden" id="oldCompanyId" value="${user.companyId}">
                        <input type="hidden" name="defaultCompanyId" id="defaultCompanyId" value="${sessionScope.SERVER_SESSION_USER.user.companyId}">
						<input class="easyui-combotree" type="text" editable="false" id="companyTree" data-options="required:true,prompt:'请输入所属公司',validType:'companyIsExists[\'companyTree\']'" missingMessage="所属公司不能为空" style="width:255px; height: 32px" value="${user.companyId}">
						</input>
					</li>
					<li>
						<label>所属员工：</label>
						<input type="hidden" name="emId" id="emId" value="${user.emId}">
						<select class="easyui-combobox" id="employeeSelect" style="width:255px; height: 32px" editable="false">
						</select>
						<span>(若该用户所选择角色最大权限是公司以外，请选择员工！)</span>
					</li>
					<li>
						<input type="hidden" name="usId" id="usId" value="${user.usId}" />
						<label>登录名称：</label>
						<input type="hidden" id="oldName" value="${user.loginName}">
						<input class="easyui-textbox"  type="text" name="loginName" id="loginName"  data-options="required:true,prompt:'请输入登录名称',validType:['loginName','loginNameIsExists'],delay:30000000,interval:30000000,validateOnBlur:true" missingMessage="登录名称不能为空"  value="${user.loginName}" style="width:255px; height: 32px"/>
					</li>
					<li>
						<label>登陆密码：</label>
						<input class="easyui-textbox"  type="text" data-options="disabled:true" value="默认密码：123456" style="width:255px; height: 32px"/>
					</li>
					<li>
						<label>用户手机：</label>
						<input type="hidden" id="oldPhone" value="${user.userPhone}">
						<input class="easyui-textbox" type="text" name="userPhone" data-options="prompt:'请输入用户手机',validType:['length[1,11]','mobile','userPhoneIsExists[\'oldPhone\']'],delay:30000000,interval:30000000,validateOnBlur:true" id="userPhone" value="${user.userPhone}" style="width:255px; height: 32px"/>
					</li>
					<li>
						<label>用户头像：</label>
						<input type="hidden" name="userPhoto" value="${user.userPhoto}">
						<input class="easyui-filebox" id="uploadfile" name="uploadfile" data-options="buttonText:'选择头像',prompt:'请选择用户头像', onChange:function(){ $('#uploadBtn').linkbutton({ disabled:false }) }" value="" style="width:255px; height: 30px" /> <a id="uploadBtn" class="easyui-linkbutton" style="width:55px; height: 28px" > 上传 </a>
						<!--以下属于上传附带参数-->
						<input type="hidden" id="fileId" name="fileId" value="${userPhoto.commonFile.fileId}"/>
						<input type="hidden" name="fkType" value="USERHEADIMG" />
						<input type="hidden" name="modelName" value="用户板块" />
						<input type="hidden" name="modelCode" value="US" />
						<input type="hidden" name="funName" value="用户头像" />
						<input type="hidden" name="funCode" value="userHeadImg" />
						<input type="hidden" id="fileName" name="fileName" value="${userPhoto.commonFile.name}" />
						<input type="hidden" id="url" name="url" value="${userPhoto.commonFile.url}" />
						<input type="hidden" id="size" name="size" />
						<input type="hidden" id="fix" name="fix" />
						<input type="hidden" id="md5" name="md5" />
					</li>
					<li>
						<label>登录状态：</label>
						<select class="easyui-combobox" type="text" name="loginStatus" id="loginStatus" validType="selectNotEmpty['登录状态']" missingMessage="登录状态不能为空" editable="false" style="width:255px; height: 32px">
							<option value="" ${!user.loginStatus ||  user.loginStatus == "" ? " selected=\"selected\"" : ""}>--请选择--</option>
							<option value="1" ${user.loginStatus == 1 ? " selected=\"selected\""  : ""} >可登录</option>
							<option value="2" ${user.loginStatus == 2 ? " selected=\"selected\""  : ""}>已禁用</option>
						</select>
					</li>
					<li>
						<label>是否接收警报：</label>
						<select class="easyui-combobox" type="text" name="receiveAlarm" id="receiveAlarm" validType="selectNotEmpty['是否接收警报']" missingMessage="是否接收警报不能为空" editable="false" style="width:255px; height: 32px">
							<option value="" ${!user.loginStatus ||  user.loginStatus == "" ? " selected=\"selected\"" : ""}>--请选择--</option>
							<option value="1" ${user.loginStatus == 1 ? " selected=\"selected\""  : ""} >接收</option>
							<option value="2" ${user.loginStatus == 2 ? " selected=\"selected\""  : ""}>不接收</option>
						</select>
					</li>
					<li>
						<label style="vertical-align: top;">备注信息：</label>
						<input class="easyui-textbox" name="remark" id="remark" data-options="multiline:true,prompt:'请输入备注信息',validType:'length[1,200]'" value="${user.remark}" style="width:255px;height:100px">
					</li>
				</ul>
				<div class="formtitle"><span>用户角色</span></div>
				<ul class="forminfo">
					<li>
						<label>设置角色：</label>
						<input type="hidden" name="roleIds" id="roleIds" value="${roleIds}">
						<ul class="easyui-tree" style="display: inline-block" id="roleCheckbox"></ul>
					</li>
				</ul>
			</div>
		</form>
		<div class="formbody" style="margin-left: 120px">
			<a id="optionUser" class="easyui-linkbutton c1" style="width:100px; height: 35px">保存</a>
			&nbsp;&nbsp;&nbsp;
			<a href="${path}/user/index.do" class="easyui-linkbutton c1" style="width:100px; height: 35px">取消</a>
		</div>
	</body>
<script>
		jQuery(document).ready(function($) {
			$.LightBox({speed:500});
		});
</script>
</html>